package com.yi.mall.user.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.yi.mall.common.model.UserInfo;
import com.yi.mall.user.mapper.UserInfoMapper;
import com.yi.mall.user.service.IUserInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 后台用户表 服务实现类
 * </p>
 *
 * @author zzy
 * @since 2025-07-08
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService {

    @Override
    public UserInfo getUserInfoByUserName(String username) {
        LambdaQueryChainWrapper<UserInfo> wrapper = new LambdaQueryChainWrapper<>(this.baseMapper);
        UserInfo userInfo = wrapper.eq(UserInfo::getUsername, username).one();
        return userInfo;
    }
}
